package com.tkmybatis.service.impl;

import com.tkmybatis.entity.ECTCnUser;
import com.tkmybatis.hfy.base.entity.Result;
import com.tkmybatis.notextendmapper.ECTCnUserMapper;
import com.tkmybatis.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class UserServiceImpl implements UserService {


    @Autowired
    private ECTCnUserMapper userMapper;
    @Override
    public Result insertUser(ECTCnUser user) {
        Result model=new Result();
        int insert = userMapper.insert(user);
        model.setMsg("插入成功");
        model.setData(insert);
        model.setRet(200+"");
        return model;

    }

    @Override
    public Result selectbyName(String name) {
        Result result=new Result();
        List<ECTCnUser> ectCnUsers = userMapper.selectByName(name);
        result.setData(ectCnUsers);
        result.setRet(200+"");
        result.setMsg("success");
        return result;

    }
}
